import githubIcon from '@renderer/assets/github.png'
import npmIcon from '@renderer/assets/npm-logo-red.png'
import baiduIcon from '@renderer/assets/baidu.png'
import bingIcon from '@renderer/assets/bing.svg'
import googleIcon from '@renderer/assets/google.png'
import juejinIcon from '@renderer/assets/juejin.png'
import scoopIcon from '@renderer/assets/scoop.jfif'
import { generateId } from '@renderer/utils'
import type { IBrowserSearch, ISystemSearch } from '@renderer/types'

export const SYSTEM_SEARCH_ITEMS: ISystemSearch[] = [
  {
    id: generateId(),
    type: 'ip',
    icon: 'NewComputer',
    name: '本机 IP 地址',
    abbreviation: 'ip',
  },
  {
    id: generateId(),
    type: 'datetime',
    icon: 'AlarmClock',
    name: '当前时间',
    abbreviation: 'dt',
  },
  {
    id: generateId(),
    type: 'snippets',
    icon: 'NotebookOne',
    name: '文本片段',
    abbreviation: 's',
    visible: false,
  },
  {
    id: generateId(),
    type: 'bookmarks',
    icon: 'Bookmark',
    name: '书签',
    abbreviation: 'bm',
  },
  {
    id: generateId(),
    type: 'uuid',
    icon: 'IdCardH',
    name: 'uuid',
    abbreviation: 'uu',
  },
  {
    id: generateId(),
    type: 'translate',
    icon: 'Translate',
    name: '翻译',
    abbreviation: 't',
  },
  {
    id: generateId(),
    type: 'apps',
    icon: 'Application',
    name: '已安装软件',
    abbreviation: 'app',
  },
]

export const BROWSER_SEARCH_ITEMS: IBrowserSearch[] = [
  {
    id: generateId(),
    type: 'google',
    name: 'Google ',
    icon: googleIcon,
    abbreviation: 'g',
    url: 'https://www.google.com/search?q=<%=query%>',
  },
  {
    id: generateId(),
    type: 'github',
    name: 'Github ',
    icon: githubIcon,
    abbreviation: 'gh',
    url: 'https://github.com/search?q=<%=query%>',
  },
  {
    id: generateId(),
    type: 'npm',
    name: 'Npm ',
    icon: npmIcon,
    abbreviation: 'npm',
    url: 'https://www.npmjs.com/search?q=<%=query%>',
  },
  {
    id: generateId(),
    type: 'bing',
    name: 'Bing ',
    icon: bingIcon,
    abbreviation: 'b',
    url: 'https://cn.bing.com/search?q=<%=query%>',
  },
  {
    id: generateId(),
    type: 'baidu',
    name: '百度',
    icon: baiduIcon,
    abbreviation: 'bd',
    url: 'https://www.baidu.com/s?wd=<%=query%>',
  },
  {
    id: generateId(),
    type: 'juejin',
    name: '掘金',
    icon: juejinIcon,
    abbreviation: 'jj',
    url: 'https://juejin.cn/search?query=<%=query%>',
  },
  {
    id: generateId(),
    type: 'scoop',
    name: 'Scoop ',
    icon: scoopIcon,
    abbreviation: 'sc',
    url: 'https://scoop.sh/#/apps?q=<%=query%>',
  },
]

export const SETTING_STORAGE_NAME = 'snip-setting'
